--[[/**
-- * 
 * 每次获得护盾值时,概率提高护盾值
-- *
-- */]]

---@class BuffEffect595100 : BaseBuffEffect
BuffEffect595100 = ClientFight.CreateClass("BuffEffect595100", ClientFight.BaseBuffEffect)
local t = BuffEffect595100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    if (table.getn(parameters) < 3) then
        return IBuffEffect.FAIL;
    end
    if (not parameters[3]) then
        return IBuffEffect.FAIL;
    end
    local result = parameters[3];
    local damage = result.damage;
    if (not result:isDamage()) then
        return IBuffEffect.FAIL;
    end
    local addValue = Utils.calcRatio(result.damage, buff.buffBean.f_BuffEffectValue[1]);
    result.damage = result.damage + addValue;

    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
            .. buff.modelId .. " 获得护盾值: " .. damage .. " 额外增加: " .. addValue .. "  ");
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()